package com.lin.chapter24.extend;


public class Client {
	public static void main(String[] args) {
		Originator originator = new Originator();
		CareTaker careTaker = new CareTaker();

		originator.setState1("中国");
		originator.setState2("强盛");
		originator.setState3("繁荣");
		System.out.println("======初始状态======\n" + originator);
		careTaker.setMemento(originator.createMemento());
		originator.setState1("软件");
		originator.setState2("架构");
		originator.setState3("优秀");
		System.out.println("======修改状态======\n" + originator);
		originator.restoreMemento(careTaker.getMemento());
		System.out.println("======恢复状态======\n" + originator);
	}
}
